package us.x.slowexp.controller.quartz;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import us.x.slowexp.service.ExpressService;

@Controller
public class TimerAlarmAction {
	
	@Autowired
	public ExpressService expressService;
	
	@RequestMapping("/timerAlarm.action")
	public String timerRequest(HttpServletResponse response) throws IOException{
		response.setCharacterEncoding("UTF-8");
		PrintWriter writer = response.getWriter();
		int count = this.expressService.queryUnfinishedCount();
		writer.write(count+"");
		writer.close();
		
		return null;
	}
}
